/*
 * @FilePath: \flutter_ducafecat_news_getx\lib\pages\musicplay\view.dart
 * @Date: 2022-07-22 09:17:46
 * @LastEditTime: 2022-07-22 15:24:11
 * @Description: 
 */
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter_ducafecat_news_getx/common/utils/iconfont.dart';
import 'package:flutter_ducafecat_news_getx/common/values/colors.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import 'controller.dart';

class MusicPlayPage extends GetView<MusicPlayController> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: AppColors.drawer,
      appBar: AppBar(
        backgroundColor: AppColors.drawer,
        title: Text('yourname'),
        actions: [Icon(Icons.share)],
      ),
      body: Container(
        height: 725.h,
        width: 375.w,
        color: AppColors.cardbg,
        child: Column(
          children: [
            //上部分摇杆加旋转动画
            Container(
                height: 600.h,
                width: 375.w,
                color: AppColors.primaryText,
                child: Container(
                  child: Stack(
                    alignment: Alignment.topCenter,
                    children: [
                      Positioned(
                          top: 100.h,
                          child: Container(
                            height: 300.w,
                            width: 300.w,
                            decoration: BoxDecoration(
                                borderRadius:
                                    BorderRadius.all(Radius.circular(150.w)),
                                color: AppColors.heijiao),
                            child: Center(
                              child: RotationTransition(
                                turns: controller.animation,
                                child: Container(
                                  height: 200.w,
                                  width: 200.w,
                                  decoration: BoxDecoration(
                                    borderRadius: BorderRadius.all(
                                        Radius.circular(100.w)),
                                    image: DecorationImage(
                                      image: AssetImage(
                                          'assets/images/feature-3.png'),
                                      fit: BoxFit.cover,
                                    ),
                                  ),
                                ),
                              ),
                            ),
                          )),
                      Positioned(
                        top: 0,
                        left: 180.w,
                        child: RotationTransition(
                          alignment: Alignment.topLeft,
                          turns: controller.yaobianimation,
                          child: Container(
                            height: 120.h,
                            width: 160.w,
                            decoration: BoxDecoration(
                                image: DecorationImage(
                                    image:
                                        AssetImage('assets/images/yaobi.png'))),
                          ),
                        ),
                      ),
                      Positioned(
                        bottom: 0,
                        width: 375.w,
                        height: 50.h,
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                          children: [
                            Icon(Iconfont.xihuan),
                            Icon(Iconfont.xiazai),
                            Icon(Iconfont.lingsheng),
                            Icon(Iconfont.fankui),
                            Icon(Icons.more_vert),
                          ],
                        ),
                      ),
                    ],
                  ),
                )),
            Container(
              height: 125.h,
              width: 375.w,
              color: AppColors.primaryElement,
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                children: [
                  Icon(Icons.repeat),
                  Icon(Icons.skip_previous_outlined),
                  Obx(() => IconButton(
                      onPressed: controller.dongChange,
                      icon: controller.state.isPlay
                          ? Icon(Icons.pause)
                          : Icon(Icons.play_arrow))),
                  Icon(Icons.skip_next_outlined),
                  Icon(Icons.menu_open_rounded),
                ],
              ),
            )
          ],
        ),
      ),
    );
  }
}
